/**
 * @param {number} n
 * @return {number}
 */
var punishmentNumber = function (n) {
  let res = 0
  for (let i = 1; i <= n; i++) {
    let mul = i * i + ''
    for (let j = 0; j < mul.length; j++) {
      const pre = mul.slice(0, j + 1)
      const suf = mul.slice(j + 1)
      // let 
      if (Number(pre) + Number(suf) == i) {
        res += Number(mul)
      }
    }
  }
  return res
};

// punishmentNumber(37)

let {length:len}= ['2']
const plus = a=>a+1
const mul = a=>a*2
// console.log(mul(plus(len)));

var name = 'aaa'
var obj = {
  name:'bbb',
  gn:function(){
    return function(){
      return this.name
    }
  }
}

var obj2={
  name:'ccc',
  gn:function(){
    var that = this
    return function(){
      return that.name
    }
  }
}

// console.log(obj.gn()());
// console.log(obj2.gn()());

let [x=y,y=1]=[]
console.log(x,y);


// var a=b=[1,2,3]
// a.push(b.shift(5))
// console.log(a);


